updating oE sum

Accumulation

sum

include math.e 
namespace math 
public function sum(object a) 

computes the sum of all atoms in the argument, no matter how deeply nested.

Parameters:
  1. values : an object, all atoms of which will be added up, no matter how nested.
Returns:

An atom, the sum of all atoms in flatten(values).

Comments:

This function may be applied to an atom or to all elements of a sequence.

Example 1:
a = sum({10, 20, 30}) 
-- a is 60 
 
a = sum({10.5, {11.2} , 8.1}) 
-- a is 29.8 
See Also:

product, or_all

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu